<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>module IRB::ExtendCommandBundle - irb: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="module">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-all_commands_info">::all_commands_info</a>
    <li ><a href="#method-c-def_extend_command">::def_extend_command</a>
    <li class="calls-super" ><a href="#method-c-extend_object">::extend_object</a>
    <li ><a href="#method-c-install_extend_commands">::install_extend_commands</a>
    <li ><a href="#method-c-load_command">::load_command</a>
    <li ><a href="#method-i-install_alias_method">#install_alias_method</a>
    <li ><a href="#method-i-irb_context">#irb_context</a>
    <li ><a href="#method-i-irb_exit">#irb_exit</a>
    <li ><a href="#method-i-irb_load">#irb_load</a>
    <li ><a href="#method-i-irb_require">#irb_require</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="module-IRB::ExtendCommandBundle">
    <h1 id="module-IRB::ExtendCommandBundle" class="module">
      module IRB::ExtendCommandBundle
    </h1>

    <section class="description">
    
<p>Installs the default irb extensions command bundle.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="NO_OVERRIDE">NO_OVERRIDE
          <dd><p>See <a href="ExtendCommandBundle.html#method-i-install_alias_method"><code>install_alias_method</code></a>.</p>
          <dt id="OVERRIDE_ALL">OVERRIDE_ALL
          <dd><p>See <a href="ExtendCommandBundle.html#method-i-install_alias_method"><code>install_alias_method</code></a>.</p>
          <dt id="OVERRIDE_PRIVATE_ONLY">OVERRIDE_PRIVATE_ONLY
          <dd><p>See <a href="ExtendCommandBundle.html#method-i-install_alias_method"><code>install_alias_method</code></a>.</p>
        </dl>
        </section>



                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-all_commands_info" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">all_commands_info</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="all_commands_info-source">
            <pre><span class="ruby-comment"># File irb/extend-command.rb, line 200</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">all_commands_info</span>
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">@@commands</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">@@commands</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-identifier">user_aliases</span> = <span class="ruby-constant">IRB</span>.<span class="ruby-constant">CurrentContext</span>.<span class="ruby-identifier">command_aliases</span>.<span class="ruby-identifier">each_with_object</span>({}) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span>(<span class="ruby-identifier">alias_name</span>, <span class="ruby-identifier">target</span>), <span class="ruby-identifier">result</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">result</span>[<span class="ruby-identifier">target</span>] <span class="ruby-operator">||=</span> []
    <span class="ruby-identifier">result</span>[<span class="ruby-identifier">target</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">alias_name</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@EXTEND_COMMANDS</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cmd_name</span>, <span class="ruby-identifier">cmd_class</span>, <span class="ruby-identifier">load_file</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">aliases</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword">defined?</span>(<span class="ruby-constant">ExtendCommand</span>) <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-constant">ExtendCommand</span>.<span class="ruby-identifier">const_defined?</span>(<span class="ruby-identifier">cmd_class</span>, <span class="ruby-keyword">false</span>)
      <span class="ruby-identifier">require_relative</span> <span class="ruby-identifier">load_file</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">klass</span> = <span class="ruby-constant">ExtendCommand</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">cmd_class</span>, <span class="ruby-keyword">false</span>)
    <span class="ruby-identifier">aliases</span> = <span class="ruby-identifier">aliases</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">first</span> }

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">additional_aliases</span> = <span class="ruby-identifier">user_aliases</span>[<span class="ruby-identifier">cmd_name</span>]
      <span class="ruby-identifier">aliases</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">additional_aliases</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">display_name</span> = <span class="ruby-identifier">aliases</span>.<span class="ruby-identifier">shift</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">cmd_name</span>
    <span class="ruby-identifier">@@commands</span> <span class="ruby-operator">&lt;&lt;</span> { <span class="ruby-value">display_name:</span> <span class="ruby-identifier">display_name</span>, <span class="ruby-value">description:</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">description</span>, <span class="ruby-value">category:</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">category</span> }
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">@@commands</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-def_extend_command" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">def_extend_command</span><span
                                class="method-args">(cmd_name, cmd_class, load_file, *aliases)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Evaluate the given <code>cmd_name</code> on the given <code>cmd_class</code> Class.</p>

<p>Will also define any given <code>aliases</code> for the method.</p>

<p>The optional <code>load_file</code> parameter will be required within the method definition.</p>

                              <div class="method-source-code" id="def_extend_command-source">
            <pre><span class="ruby-comment"># File irb/extend-command.rb, line 253</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">def_extend_command</span>(<span class="ruby-identifier">cmd_name</span>, <span class="ruby-identifier">cmd_class</span>, <span class="ruby-identifier">load_file</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">aliases</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">cmd_class</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Symbol</span>
    <span class="ruby-identifier">cmd_class</span> = <span class="ruby-identifier">cmd_class</span>.<span class="ruby-identifier">id2name</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Class</span>
    <span class="ruby-identifier">cmd_class</span> = <span class="ruby-identifier">cmd_class</span>.<span class="ruby-identifier">name</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">line</span> = <span class="ruby-keyword">__LINE__</span>; <span class="ruby-identifier">eval</span> <span class="ruby-node">%[
    def #{cmd_name}(*opts, **kwargs, &amp;b)
      Kernel.require_relative &quot;#{load_file}&quot;
      ::IRB::ExtendCommand::#{cmd_class}.execute(irb_context, *opts, **kwargs, &amp;b)
    end
  ]</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">__FILE__</span>, <span class="ruby-identifier">line</span>

  <span class="ruby-keyword">for</span> <span class="ruby-identifier">ali</span>, <span class="ruby-identifier">flag</span> <span class="ruby-keyword">in</span> <span class="ruby-identifier">aliases</span>
    <span class="ruby-ivar">@ALIASES</span>.<span class="ruby-identifier">push</span> [<span class="ruby-identifier">ali</span>, <span class="ruby-identifier">cmd_name</span>, <span class="ruby-identifier">flag</span>]
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-extend_object" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">extend_object</span><span
                                class="method-args">(obj)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Installs alias methods for the default irb commands on the given object using <a href="ExtendCommandBundle.html#method-i-install_alias_method"><code>install_alias_method</code></a>.</p>
                                <div class="method-calls-super">
                                  Calls superclass method
                                  
                              </div>

                              <div class="method-source-code" id="extend_object-source">
            <pre><span class="ruby-comment"># File irb/extend-command.rb, line 302</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">extend_object</span>(<span class="ruby-identifier">obj</span>)
  <span class="ruby-keyword">unless</span> (<span class="ruby-keyword">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">obj</span>; <span class="ruby-identifier">ancestors</span>; <span class="ruby-keyword">end</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-constant">EXCB</span>)
    <span class="ruby-keyword">super</span>
    <span class="ruby-keyword">for</span> <span class="ruby-identifier">ali</span>, <span class="ruby-identifier">com</span>, <span class="ruby-identifier">flg</span> <span class="ruby-keyword">in</span> <span class="ruby-ivar">@ALIASES</span>
      <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">install_alias_method</span>(<span class="ruby-identifier">ali</span>, <span class="ruby-identifier">com</span>, <span class="ruby-identifier">flg</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-install_extend_commands" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_extend_commands</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Installs the default irb commands.</p>

                              <div class="method-source-code" id="install_extend_commands-source">
            <pre><span class="ruby-comment"># File irb/extend-command.rb, line 241</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">install_extend_commands</span>
  <span class="ruby-keyword">for</span> <span class="ruby-identifier">args</span> <span class="ruby-keyword">in</span> <span class="ruby-ivar">@EXTEND_COMMANDS</span>
    <span class="ruby-identifier">def_extend_command</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-load_command" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">load_command</span><span
                                class="method-args">(command)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Convert a command name to its implementation class if such command exists</p>

                              <div class="method-source-code" id="load_command-source">
            <pre><span class="ruby-comment"># File irb/extend-command.rb, line 227</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">load_command</span>(<span class="ruby-identifier">command</span>)
  <span class="ruby-identifier">command</span> = <span class="ruby-identifier">command</span>.<span class="ruby-identifier">to_sym</span>
  <span class="ruby-ivar">@EXTEND_COMMANDS</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cmd_name</span>, <span class="ruby-identifier">cmd_class</span>, <span class="ruby-identifier">load_file</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">aliases</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">cmd_name</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">command</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">aliases</span>.<span class="ruby-identifier">all?</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">alias_name</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span> <span class="ruby-identifier">alias_name</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">command</span> }

    <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword">defined?</span>(<span class="ruby-constant">ExtendCommand</span>) <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-constant">ExtendCommand</span>.<span class="ruby-identifier">const_defined?</span>(<span class="ruby-identifier">cmd_class</span>, <span class="ruby-keyword">false</span>)
      <span class="ruby-identifier">require_relative</span> <span class="ruby-identifier">load_file</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">return</span> <span class="ruby-constant">ExtendCommand</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">cmd_class</span>, <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-install_alias_method" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_alias_method</span><span
                                class="method-args">(to, from, override = NO_OVERRIDE)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Installs alias methods for the default irb commands, see <a href="ExtendCommandBundle.html#method-c-install_extend_commands"><code>::install_extend_commands</code></a>.</p>

                              <div class="method-source-code" id="install_alias_method-source">
            <pre><span class="ruby-comment"># File irb/extend-command.rb, line 276</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_alias_method</span>(<span class="ruby-identifier">to</span>, <span class="ruby-identifier">from</span>, <span class="ruby-identifier">override</span> = <span class="ruby-constant">NO_OVERRIDE</span>)
  <span class="ruby-identifier">to</span> = <span class="ruby-identifier">to</span>.<span class="ruby-identifier">id2name</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">to</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>)
  <span class="ruby-identifier">from</span> = <span class="ruby-identifier">from</span>.<span class="ruby-identifier">id2name</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">from</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">override</span> <span class="ruby-operator">==</span> <span class="ruby-constant">OVERRIDE_ALL</span> <span class="ruby-keyword">or</span>
      (<span class="ruby-identifier">override</span> <span class="ruby-operator">==</span> <span class="ruby-constant">OVERRIDE_PRIVATE_ONLY</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">to</span>) <span class="ruby-keyword">or</span>
      (<span class="ruby-identifier">override</span> <span class="ruby-operator">==</span> <span class="ruby-constant">NO_OVERRIDE</span>) <span class="ruby-operator">&amp;&amp;</span>  <span class="ruby-operator">!</span><span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">to</span>, <span class="ruby-keyword">true</span>)
    <span class="ruby-identifier">target</span> = <span class="ruby-keyword">self</span>
    (<span class="ruby-keyword">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">self</span>; <span class="ruby-keyword">self</span>; <span class="ruby-keyword">end</span>).<span class="ruby-identifier">instance_eval</span>{
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">target</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">to</span>, <span class="ruby-keyword">true</span>) <span class="ruby-operator">&amp;&amp;</span>
        <span class="ruby-operator">!</span><span class="ruby-identifier">target</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-constant">EXCB</span>.<span class="ruby-identifier">irb_original_method_name</span>(<span class="ruby-identifier">to</span>), <span class="ruby-keyword">true</span>)
        <span class="ruby-identifier">alias_method</span>(<span class="ruby-constant">EXCB</span>.<span class="ruby-identifier">irb_original_method_name</span>(<span class="ruby-identifier">to</span>), <span class="ruby-identifier">to</span>)
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">alias_method</span> <span class="ruby-identifier">to</span>, <span class="ruby-identifier">from</span>
    }
  <span class="ruby-keyword">else</span>
    <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;irb: warn: can&#39;t alias #{to} from #{from}.\n&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-irb_context" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">irb_context</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Displays current configuration.</p>

<p>Modifying the configuration is achieved by sending a message to <a href="../IRB.html#method-c-conf"><code>IRB.conf</code></a>.</p>

                              <div class="method-source-code" id="irb_context-source">
            <pre><span class="ruby-comment"># File irb/extend-command.rb, line 31</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">irb_context</span>
  <span class="ruby-constant">IRB</span>.<span class="ruby-constant">CurrentContext</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-irb_exit" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">irb_exit</span><span
                                class="method-args">(ret = 0)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Quits the current irb context</p>

<p><code>ret</code> is the optional signal or message to send to <a href="Context.html#method-i-exit"><code>Context#exit</code></a></p>

<p>Same as <code>IRB.CurrentContext.exit</code>.</p>

                              <div class="method-source-code" id="irb_exit-source">
            <pre><span class="ruby-comment"># File irb/extend-command.rb, line 24</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">irb_exit</span>(<span class="ruby-identifier">ret</span> = <span class="ruby-value">0</span>)
  <span class="ruby-identifier">irb_context</span>.<span class="ruby-identifier">exit</span>(<span class="ruby-identifier">ret</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-irb_load" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">irb_load</span><span
                                class="method-args">(*opts, &amp;b)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Loads the given file similarly to Kernel#load, see <a href="IrbLoader.html#method-i-irb_load"><code>IrbLoader#irb_load</code></a></p>

                              <div class="method-source-code" id="irb_load-source">
            <pre><span class="ruby-comment"># File irb/ext/use-loader.rb, line 19</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">irb_load</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
  <span class="ruby-constant">ExtendCommand</span><span class="ruby-operator">::</span><span class="ruby-constant">Load</span>.<span class="ruby-identifier">execute</span>(<span class="ruby-identifier">irb_context</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-irb_require" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">irb_require</span><span
                                class="method-args">(*opts, &amp;b)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Loads the given file similarly to Kernel#require</p>

                              <div class="method-source-code" id="irb_require-source">
            <pre><span class="ruby-comment"># File irb/ext/use-loader.rb, line 24</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">irb_require</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
  <span class="ruby-constant">ExtendCommand</span><span class="ruby-operator">::</span><span class="ruby-constant">Require</span>.<span class="ruby-identifier">execute</span>(<span class="ruby-identifier">irb_context</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">opts</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

